from django.conf.urls.defaults import *
from django.contrib.auth import views as auth_views
from django.conf import settings

from django.views.generic.simple import redirect_to

import views

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.PROJECT_DIR+"/static/",'show_indexes': True}),

    (r'^$', redirect_to, {'url': '/accounts/profile/'}),

    (r'^download/([^/]+)/([^/]+)$', views.download),

    (r'^file/(\d+)/toggle-state/$', views.change_file_state),
    (r'^file/(\d+)/delete/$', views.delete_file),
    (r'^file/(\d+)/downloads/$', views.get_file_downloads_count),
    (r'^file/(\d+)/uuid/$', views.get_file_uuid_by_id),

    (r'^file/([\d\w-]+)/id/$', views.get_file_id_by_uuid),

    (r'^file/all/$', views.allfiles),

    (r'^accounts/profile/$', views.profile),
    (r'^accounts/profile/upload/$', views.upload),
    (r'^accounts/login/$',auth_views.login,{'template_name': 'login.html'}),
    (r'^accounts/logout/$',auth_views.logout,{'template_name': 'logout.html'}),
)
